var submitOptionObj = {
    el: '#pageApp',
    data: {
      placeholder:'说点什么吧',
      option:'',
      artileId:'',
      type:''
    },
    components:{
     
    },
    methods: {
      submitOption:function(){
        if(!this.option){
          g.modal.tip({title:'评论内容不能为空！'});
          return;
        }
        var _this = this , relationType = 1;
        if(_this.type == 3){
           relationType = 2
        };
        g.ajax({
          type: 'POST',
          url: g.url.format('/api/author/comment'),
          data:{
            relationId:_this.artileId,
            relationType:relationType,
            parentId:0,
            text:_this.option
          },
          success: function (result) {
              if(_this.type == 3){
                // g.window.openNew(g.url.urlHref('/page/beautyImg.html?id='+ _this.artileId));
                history.go(-1);
              }else{
                g.window.openNew(g.url.urlHref('/page/articleDetail.html?id='+ _this.artileId +'&type='+ _this.type));
              };
              
          }
        });
      }
    },
    mounted:function () {
       this.artileId = g.params.get('id') ||''; 
       this.type = g.params.get('type');
       if(this.type == 3){
         this.placeholder = '请输入评论内容';
       }
    }
};
var initPage = function(){
  new Vue(submitOptionObj);
};